package com.ditri.distrident.api;

import com.ditri.distrident.common.dto.request.AdminLoginReq;
import com.ditri.distrident.common.dto.response.AdminLoginResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * @Author: edxuanlen
 * @Date: 2020/8/1:15:42
 */

@Api
@RequestMapping(value = "/admin")
public interface AdminLoginApi {
    /**
     * 用户登陆
     *
     * @param adminLoginReq 传入用户输入的账号和密码
     * @param bindingResult 获取校验错误信息
     * @return ROOT INFO
     * @Author: edxuanlen
     */
    @RequestMapping(value = "/login",
            produces = {"application/json;charset=UTF-8"},
            consumes = {"application/json;charset=UTF-8"},
            method = RequestMethod.POST)

    @ApiOperation(
            value = "admin 登陆", notes = "用户查询",
            response = AdminLoginReq.class, tags = {"adminLogin-Api"})
    @ApiResponses(value = {
            @ApiResponse(code = 200, message = "成功", response = AdminLoginResp.class),
            @ApiResponse(code = 500, message = "内部错误", response = AdminLoginResp.class)})
    AdminLoginResp checkPassword(@RequestBody @Validated AdminLoginReq adminLoginReq, BindingResult bindingResult);


}
